$(function(){
    $("#file_upload").uploadify({
        'swf'      : 'uploadify/uploadify.swf',
        'uploader' : 'uploadify/uploadify.php',
        'buttonClass' : 'my_btn',
        'fileTypeExts' : '*.gif; *.jpg; *.png',
        'width':uploadBtnSize().width,
        'height':uploadBtnSize().height,
        'buttonText' : '上传照片',
        'onUploadSuccess' : function(){
            imgReview();
        }
    });
    function uploadBtnSize(){
        var size={};
        size.width=58;
        size.height=48;
        var w=window.screen.width;
        if(w<1280){
            size.width=49;
            size.height=40;
        }
        return size;
    }
    function imgReview(url){
        var img=new Image();
        img.src="http://img3.cache.netease.com/cnews/2014/3/22/20140322120020f93fd.jpg";
        img.width=100;img.height=100;
        $('.review').show().find('.img_review').empty().append(img);
    }
    /*评论文本输入框*/
    $('#comment').focus(function(){
            if(this.value==this.defaultValue){
                this.value="";
            }
    }).blur(function(){
            if(this.value==""){
                this.value=this.defaultValue;
            }
        });
    /*确认上传*/
    $('#submit_record').click(function(check){
        $('.global_pop').show().load("upload_review.html",function(data){
            popPosition();
            heightOver();

        });
        check.preventDefault();
    });
    /*确认提交*/
   $('.affirm').live("click",function(){
       $('.global_pop').css("top",50+"%").empty().load("user_form.html",function(data){
           popPosition();

       });
   });
    /*右侧已有评论查看*/
    $('.comment_list li').click(function(){
       $('.global_pop').empty().load("upload_review.html",function(data){
           $(".upload_pop").height(658);
           $('.upload_control').remove();
           popPosition();
           heightOver();
       })
    });

});

